
/*
 * @Description: 流程设计模型部署表 - 接口
 * @Author: DHL
 * @Date: 2022-08-23 15:26:03
 * @LastEditors: DHL
 * @LastEditTime: 2022-08-25 13:49:16
 */

import { $get, $post, $put, $exportExcel } from '/@/utils/http'
import { ContentTypeEnum } from '/@/constant/http'
import {
  ActReModelModel,
  ActReModelParams,
  ActReModelPageParams,
  ActReModelPageResultModel,
  ActReModelResultModel
} from './model/actReModelModel'
import { Result } from '/@/model/baseModel'

/**
 * 分页查询
 */
export const apiActReModelSearch = (searchParams: ActReModelPageParams) =>
  $get<ActReModelPageResultModel>({
    url: '/actReModel/search',
    params: searchParams
  })

/**
 * 根据ID获取详情
 */
export const apiActReModelGetById = (id: string) =>
  $get<ActReModelResultModel>({
    url: '/actReModel/getById',
    params: { id: id }
  })

/**
 * 保存信息
 */
export const apiActReModelSave = (saveParams: ActReModelModel) =>
  $post<ActReModelResultModel>({
    url: '/actReModel/save',
    contentType: ContentTypeEnum.json,
    params: saveParams
  })

/**
 * 更新信息
 */
export const apiActReModelUpdateById = (updateParams: ActReModelModel) =>
  $put<ActReModelResultModel>({
    url: '/actReModel/updateById',
    contentType: ContentTypeEnum.json,
    params: updateParams
  })

/**
 * 批量删除信息
 */
export const apiActReModelBatchDeleteByIds = (ids: string) =>
  $post<ActReModelResultModel>({
    url: '/actReModel/batchDeleteByIds',
    params: { ids: ids }
  })

/**
 * 复制流程
 * @param id 
 * @returns 
 */
export const apiActReModelCopy = (id: string) =>
  $post<Result<string>>({
    url: '/actReModel/copy',
    params: { id: id }
  })

/**
 * 流程模型设计保存
 * @param saveParams 
 * @returns 
 */
export const apiActReModelSaveModelDesigner = (saveParams: { id: string, editor: string }) =>
  $post<Result<string>>({
    url: '/actReModel/saveModelDesigner',
    params: saveParams
  })

/**
 * 流程部署
 * @param id 
 * @returns 
 */
export const apiActReModelDeploy = (id: string) =>
  $post<Result<string>>({
    url: '/actReModel/deploy',
    params: { id: id }
  })